﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace AntMovement.WPF.Converter.Status
{
    [ValueConversion(typeof(long), typeof(string))]
    public class IntToDeviceStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            long i = System.Convert.ToInt64(value);
            switch (i)
            {
                case 1:
                    return "手动";//设备手动--待机
                case 2:
                    return "自动运行";//设备自动运行
                case 3:
                    return "报警";//设备报警
                case 4:
                    return "暂停";//设备暂停
                case 5:
                    return "维修";//停机维修
                case 6:
                    return "堵料";//堵料
                case 7:
                    return "待料";//待料
                case 8:
                    return "堵料待料";//堵料待料
            }
            return "板卡未链接";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
